//  * Physical
//  * Render
// ** Application Defined

namespace Epsilon {
  namespace Material {
    namespace Physical {
      // solid
    };
    namespace Render {
      // Effect* effects;

      // shadow
      // visible

      // Light Properties: {
      //   Lighting Model
      //   NormalMap
      //   SpecularMap
      //   RefractionMap
      //   GlowMap
      //   EnvironmentMappedBumpMap
      //
      //   Shaders {
      //     VertexFragment_DepthOnly
      //     VertexFragment_Diffuse
      //     VertexFragment_Bump
      //     VertexFragment_BumpSpecular
      //     VertexFragment_BumpRefraction
      //     VertexFragment_BumpSpecularRefraction
      //     VertexFragment_EMBM
      //     VertexFragment_ShadowVolume
      //   }
      // }

      // Shadow Properties {
      //   Shadow Technique
      // }

      // LevelOfDetail {
      //   NumLevels
      //   AutoGen
      // }

      // 
      //
      //
    };
  };
};

// Effect
// Effect::DepthOnly
// Effect::Diffuse
// Effect::Bump
// Effect::BumpSpecular
// Effect::BumpRefraction
// Effect::BumpSpecularRefraction
// Effect::EMBM
// Effect::ShadowVolume

class e3dTexture;
class e3dVertexShader;
class e3dPixelShader;

class e3dEffect {
public:
private:
};

class e3dEffectDepth : public e3dEffect {
public:
protected:
private:
  e3dVertexShader* vertex_shader;
  e3dPixelShader*  pixel_shader;
}

class e3dEffectDiffuse : public e3dEffect {
public:
protected:
  e3dTexture* diffuse_map;

private:
  e3dVertexShader* vertex_shader;
  e3dPixelShader*  pixel_shader;
}

class e3dEffectBump : public e3dEffect {
public:
protected:
  e3dTexture* normal_map;

private:
  e3dVertexShader* vertex_shader;
  e3dPixelShader*  pixel_shader;
}

class e3dEffectSpecular : public e3dEffect {
public:
protected:
  e3dTexture* specular_map;

private:
  e3dVertexShader* vertex_shader;
  e3dPixelShader*  pixel_shader;
}


namespace Epsilon {
  namespace Effects {
    enum {
      None     = 0x00,

      Depth    = 0x01,
      Diffuse  = 0x02,
      Bump     = 0x04,
      Specular = 0x08,

      UserEffectBase
    };
  };
};

typedef int e3dEffectFlags;


/*
namespace Epsilon {
  namespace Material {
    namespace Types {
      enum MaterialType {
*/


class e3dMaterial
{
public:
  e3dMaterial (void) {
    solid   = true;
    visible = true;
    shadow  = false;
  }

  virtual ~e3dMaterial (void) {
    for (int i = 0; i < effects.size (); i++) {
      delete effects [i];
    }

    effects.clear ();
  }

  bool HasDepth   (void) { effect_flags & Epsilon::Effects::Depth   };
  bool HasDiffuse (void) { effect_flags & Epsilon::Effects::Diffuse };

private:
  bool solid;
  bool visible;
  bool shadow;

  vector<e3dEffect*> effects;
  e3dEffectFlags     effect_flags;

  TCHAR name [64];
};